package com.attendcollatesys.mapper;

import com.attendcollatesys.entity.ATDayDetails;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface ATDayDetailMapper {

    int insertBatch(List<ATDayDetails> list);

    int deleteByDayRtxList(List<String> list);

    List<ATDayDetails> selByAttendanceDateAndRtx(@Param("yearMonth") String yearMonth,@Param("rtxNumber") String rtxNumber);

    List<String> selRtxByNameDateRtx(@Param("currentMonth")String currentMonth,@Param("name") String name,@Param("rtxNumber") String rtxNumber);

    String selMaxDayOfMonth(@Param("year") String year,@Param("month") String month);

    /**
     *
     * @param attendanceDate  yyyy-MM-dd
     */
    List<ATDayDetails> selOverTimeByRtxNameDate(@Param("attendanceDate") String attendanceDate,
                                                @Param("name") String name,
                                                @Param("rtxNumber") String rtxNumber,
                                                @Param("startRow")Integer startRow,
                                                @Param("pageSize")Integer pageSize);

    int countOverTimeByRtxNameDate(@Param("attendanceDate") String attendanceDate,
                                   @Param("name") String name,
                                   @Param("rtxNumber") String rtxNumber);

    /**
     * 用于查询开始与结束日期之间是数据
     * @param startDate
     * @param endDate
     * @param name
     * @param rtxNumber
     * @return
     */
    List<ATDayDetails> selectOneDetailByDateAndRtx(@Param("startDate")String startDate,@Param("endDate")String endDate, @Param("name") String name, @Param("rtxNumber") String rtxNumber);

    int checkDataExist(@Param("list")List<String> date,@Param("rtxNumber")String rtxNumber);
}
